/* 创建临时文件 191.c */


.LC0:
	.string "\nhello world\nhello mingri"

.LC1:
	.string "%c"

.globl main


main:
	pushq %rbp
	movq %rsp,%rbp
	subq $0x1000,%rsp

	movq $0,-0x1000(%rbp) /* temp */
	movb $0,-0xff8(%rbp) /* c */
	
	movl $0,%eax
	call tmpfile 
	movq %rax,-0x1000(%rbp) /* temp */
	cmpq $0,-0x1000(%rbp) /* temp */
	je .Lmain_400

	movq -0x1000(%rbp),%rsi /* temp */
	leaq .LC0(%rip),%rdi 
	movl $0,%eax 
	call fputs 

.Lmain_400:
	movq -0x1000(%rbp),%rdi /* temp */
	movl $0,%eax 
	call rewind 

	jmp .Lmain_300


.Lmain_390:
	movb -0xff8(%rbp),%al /* c */
	movsbl %al,%esi 
	lea .LC1(%rip),%rdi
	movl $0,%eax 
	call printf 

.Lmain_300:
	movq -0x1000(%rbp),%rdi /* temp */
	movl $0,%eax
	call fgetc 
	movb %al,-0xff8(%rbp) /* c */
	cmpb $-1,-0xff8(%rbp) /* c */
	jne .Lmain_390

	movq -0x1000(%rbp),%rdi /* temp */
	movl $0,%eax 
	call fclose 

	movl $0,%eax
	leave
	ret
